package creational.pattern.factory.help;

import lombok.Data;

import java.util.*;


/**
 * @Author yoyuan
 * @Description: 对象的解析器，spring中也有，这里自定义一个
 * @DateTime: 2023/1/8 16:23
 */
@Data
public class BeanDefinition {
    private String id;
    private String className;
    private List<ConstructorArg> constructors = new ArrayList<>();
    private Scope scope = Scope.SINGLETON;
    private boolean lazyInit = false;
    public BeanDefinition(){};

    public BeanDefinition(String id, String className){
        this.id = id;
        this.className = className;
    }
    public static enum Scope{
        SINGLETON,PROTOTYPE;
    }
    public boolean isSingleton(){
        return this.scope == Scope.SINGLETON;
    }

    @Data
    public static class ConstructorArg{
        private boolean ref;
        private Class<?> Type;
        private Object arg;
    }

}
